home *** CD-ROM | disk | FTP | other *** search
/ Deutsche Edition 2 / Deutsche Edition 2.iso / mac / PROGRAMME / ARTAbrot 1.1 ƒ / DSPManager.h < prev    next >
Text File  |  1993-03-26  |  34KB  |  705 lines

  1. /*
  2.     File:        DSPManager.h
  3.  
  4.     Contains:
  5.  
  6.     Written by:
  7.         Hugh Svendsen, ATG Sound
  8.         A. Phil Sohn, ATG Sound
  9.         Eric Behnke
  10.         Jeff Boone
  11.  
  12.     Copyright:    © 1990-1992 by Apple Computer, Inc., all rights reserved.
  13.  
  14.     Change History (most recent first):
  15.  
  16.        <LW5>      3/8/93    ejb        define new trap DSPLoadSlotDrivers
  17.        <LW4>     2/10/93    ejb        add prototypes for new traps: CreateAliasToResfile and
  18.                                     RebootCPUDevice
  19.        <LW3>    12/21/92    ejb        added new internal trap DSPGetResource
  20.        <LW2>    12/18/92    JDB        EJB: Added DeviceCall and DriverCall traps.
  21.       <SM14>    12/10/92    JDB        Added DSPLoadKernel & DSPAllocateSegment Traps
  22.       <SM13>     12/2/92    JDB        Making all calls traps: Part II
  23.       <SM12>     12/2/92    JDB        Making all calls traps: Part I
  24.       <SM11>     12/1/92    ejb        changed sample and frame rates from unsigned long to fixed
  25.                                     numbers.
  26.       <SM10>    11/20/92    JDB        Added DSPPatchPrevAndNext trap number.
  27.        <SM9>    11/13/92    JDB        Added public selectors and trap numbers for
  28.                                     DSPAllocateDriverFIFO and DSPDisposeDriverFIFO.
  29.        <SM8>    10/27/92    JDB        Added DSPGetPtrSize trap number for the (internal) call used for
  30.                                     parameter checking.
  31.        <SM7>     9/11/92    APS        Renamed DSPAllocateModule to DSPCreateModule. The original name
  32.                                     was confusing, and I wanted to write another DSPAllocateModule.
  33.        <SM6>      9/9/92    APS        Fixed a couple of typos.
  34.        <SM5>     6/23/92    JDB        DSPFIFOClearInterrupt, DSPFIFOSetRefCon, DSPFIFOReset and
  35.                                     DSPSetTaskRefCon now return OSErrÕs.
  36.        <SM4>     6/22/92    JDB        d12 final candidate roll-in.
  37.         <97>     6/22/92    JDB        Moved SignIn/SignOut CPUDevice/IODevice traps from DSPManager.h
  38.                                     to DSPManagerPrivate.h
  39.         <96>     6/22/92    APS        Added traps for DSPGetAvailableOnChipMemory and
  40.                                     DSPSetSectionSize.
  41.         <95>     6/22/92    APS        Changed the DSPCPUDeviceParamBlk by adding cpuTimeShareFreqand
  42.                                     cpuClientCallbackProc.
  43.        <SM3>     6/21/92    ejb        Checked in BOMII d12 release.
  44.       --------------------------------------------------------------------------------------------------
  45.         <94>     6/19/92    JDB        Added traps to get and set the MessageActionProc for a FIFO.
  46.         <93>     6/16/92    APS        Modified DSPSetGPBMode.
  47.         <92>     6/16/92    APS        Added DSPGPBModeIndicator.
  48.         <91>     6/15/92    JDB        Changed DSPProcessMessage to DSPClientMessageDispatch.
  49.         <90>     6/12/92    JDB        Added kdspProcessMessage trap constant.
  50.         <89>      6/9/92    EJB        Changed iopbCPUDeviceIndex to iopbIODeviceINdex since this is
  51.                                     what is documented and it makes more sense this way.
  52.         <88>      6/4/92    APS        Renamed DSPSetFIFOMessageThreshold to
  53.                                     DSPFIFOSetMessageThreshold.
  54.         <87>      6/4/92    APS        Added the DSPDisposeZone trap.
  55.         <86>      6/3/92    JDB        Added the ConnectHIHOSections trap number. Also added the
  56.                                     kdspHIHOConnection to the possible connection types.
  57.         <85>      6/2/92    APS        Added traps for DSPFIFOGetMessageDispatch, DSPUpdateGPBPrefFile,
  58.                                     DSPSetFIFOMessageThreshold, DSPFIFOSwap, DSPSetGPBMode,
  59.                                     DSPDontUpdateGPBPrefs, and DSPUpdateGPBPreferenceFile.
  60.         <84>     5/29/92    EJB        Changed SignInIODevice, SignOutIODevice, and SignOutCPUDevice
  61.                                     APIs to be multi-dsp aware.
  62.         <83>     5/28/92    JDB        Adding DSPGetTaskInfo and DSPSetCPUDeviceBondage calls.
  63.         <82>     5/28/92    APS        Fixed the arguments to DSPDisposeFIFO.
  64.         <81>     5/21/92    JDB        Added cpuProcessorNum to parameters of DSPSignInCPUDevice to
  65.                                     support multiple DSPs.
  66.         <80>     5/21/92    APS        Made Rev. 4 Linked FIFO changes.
  67.         <79>     4/24/92    APS        Updated kdspManagerBuildVersion. The FIFO APIs have changed
  68.                                     among other things.
  69.         <78>     4/21/92    APS        Added DSPAddressInZone
  70.          4/16/92 JDB - Added the calls to support the new task synchronization model.
  71.          4/15/92 APS - Changed the Dispatch mechanism
  72.         04/08/92 JDB - Removing the DSPFIFOPtr and DSPFIFOHandle declarations.
  73.          4/ 3/92 APS - Added Support for LinkedFIFOs
  74.         10/15/91 APS - Removed DSPEnoughGPB
  75.         10/15/91 JDB - Added reference number data types for DSPModule, DSPSection
  76.                         & DSPFIFO
  77.         09/27/91 APS - Removed elements associated with Bombugs
  78.         05/22/91 APS - Removed DSPInsertRelativeTask
  79.  
  80. */
  81.  
  82. //======================================================================================
  83. #ifndef __DSPManager__
  84. #define __DSPManager__
  85. #include <types.h>
  86.  
  87. //--------------------------------------------------------------------------------------
  88. // DSPManager Version Number
  89. //
  90. // 0x09     changes DSPNewTask & DSPInsertTask
  91. // 0x0A HBS DSPIODevice calls now require a iopbDeviceType to be passed in the parameter
  92. //            block
  93. // 0x0B APS Changed DSPModule Structure
  94. // 0x0C APS FIFO API changed.
  95. // 0x0D    APS    FIFO API Changed again (Linked FIFOs Rev. 4)
  96. //--------------------------------------------------------------------------------------
  97. #define kdspManagerBuildVersion        0x0000000D
  98.  
  99. //======================================================================================
  100. //                             N E W  D A T A  T Y P E S
  101. //======================================================================================
  102. typedef unsigned long    DSPPosition;            // type for position parameter
  103. typedef unsigned long     DSPCycles;                // type for processing bandwidth
  104. typedef unsigned long    DSPClientRefNum;        // type for DSPClient reference number
  105. typedef unsigned long    DSPIODeviceRefNum;        // type for DSPIODevice reference number
  106. typedef unsigned long    DSPCPUDeviceRefNum;        // type for DSPCPUDevice reference number
  107. typedef unsigned long    DSPTaskRefNum;            // type for DSPTask reference number
  108. typedef unsigned long    DSPModuleRefNum;        // type for DSPModule reference number
  109. typedef unsigned long    DSPSectionRefNum;        // type for DSPSection reference number
  110. typedef unsigned long    DSPFIFORefNum;            // type for DSPFIFO reference number
  111. typedef unsigned long    DSPLinkedFIFORefNum;    // type for DSPLinkedFIFO reference number
  112. typedef unsigned long    DSPSynchRefNum;            // type for TaskToSynch and SynchTasks reference number
  113. typedef pascal void (*MessageActionProc)(struct DSPMessage *theMessage);
  114.  
  115. enum DSPConnectionType {
  116.     kdspDirectConnection,
  117.     kdspIndirectConnection,
  118.     kdspHIHOConnection
  119. };
  120.  
  121. enum DSPTaskPriority {
  122.     kdspRealTime,
  123.     kdspTimeShare
  124. };
  125.  
  126. typedef enum { 
  127.     kdspTaskIsActive, 
  128.     kdspTaskIsInactive, 
  129.     kdspTaskIsGoingInactive, 
  130.     kdspTaskIsGoingActive, 
  131.     kdspInvalidTask 
  132. } DSPTaskStatus;
  133.  
  134. #ifndef __cplusplus
  135. typedef struct    DSPDeviceParamBlk        DSPDeviceParamBlk;
  136. typedef struct    DSPCPUDeviceParamBlk    DSPCPUDeviceParamBlk;
  137. typedef struct    DSPIODeviceParamBlk        DSPIODeviceParamBlk;
  138. typedef struct    DSPBIODeviceParamBlk    DSPBIODeviceParamBlk;
  139. typedef    struct    DSPSIODeviceParamBlk    DSPSIODeviceParamBlk;
  140. typedef struct    DSPFIFO                    DSPFIFO;
  141. typedef struct    DSPFIFOAddress            DSPFIFOAddress;
  142. typedef struct    DSPMessage                DSPMessage;
  143. typedef struct    DSPClientInfoParamBlk    DSPClientInfoParamBlk;
  144. typedef struct    DSPTaskInfoParamBlk        DSPTaskInfoParamBlk;
  145. typedef struct    DSPModuleInfoParamBlk    DSPModuleInfoParamBlk;
  146. typedef struct    DSPSectionInfoParamBlk    DSPSectionInfoParamBlk;
  147. typedef struct    DSPGPBModeIndicator        DSPGPBModeIndicator;
  148. typedef enum    DSPConnectionType        DSPConnectionType;
  149. typedef enum    DSPTaskPriority            DSPTaskPriority;
  150. #endif
  151.  
  152. //======================================================================================
  153. //                                 S T R U C T U R E S
  154. //======================================================================================
  155. //======================================================================================
  156. // DSPFIFOAddress
  157. //======================================================================================
  158. struct DSPFIFOAddress {
  159.     struct DSPFIFO *l;            // logical pointer
  160.     struct DSPFIFO *p;            // physical pointer
  161.     };
  162.  
  163. //======================================================================================
  164. // DSPParamBlkHeader
  165. //        this parameter block header is shared between the DSPIODeviceParamblock
  166. //        and the DSPCPUDeviceParamBlk. The reason we declare things this way is so that
  167. //        we can have routines that operate only on the common parts of the structures
  168. //        therefore making the code smaller, easier to write, easier to maintain, etcÉ
  169. //
  170. //        pbhDeviceIndex            the index for this device
  171. //        pbhClientPermission        read/write permission for this client
  172. //        pbhClientRefNum            the reference number for this client
  173. //        pbhClientName            the name of this client
  174. //        pbhDeviceName            the device name for the io or cpu device
  175. //        pbhDeviceICON            the device icon for the io or cpu device
  176. //
  177. //======================================================================================
  178. #define DSPDeviceParamBlkHeader\
  179.     unsigned short            pbhDeviceIndex;\
  180.     unsigned short            pbhClientPermission;\
  181.     DSPClientRefNum            pbhClientRefNum;\
  182.     Str31                    pbhClientName;\
  183.     Handle                    pbhClientICON;\
  184.     Str31                    pbhDeviceName;\
  185.     Handle                    pbhDeviceICON;
  186.  
  187. //======================================================================================
  188. // DSPDeviceParamBlk:
  189. //======================================================================================
  190. struct DSPDeviceParamBlk {
  191.     DSPDeviceParamBlkHeader
  192.     };
  193.  
  194. //======================================================================================
  195. // DSPCPUDeviceParamBlk:
  196. //        this parameter block is used for controlling a cpu device. It shares the
  197. //        DSPParamBlkHeader with the io device.
  198. //======================================================================================
  199. struct DSPCPUDeviceParamBlk {
  200.     DSPDeviceParamBlkHeader
  201.     unsigned char        cpuSlotNumber;            // the slot number the card is in
  202.     unsigned char        cpuProcessorNumber;        // the processor number, zero based
  203.     OSType                cpuProcessorType;        // the type of the processor
  204.     DSPCycles            cpuMaxCycles;            // max processor execution cycles per frame
  205.     DSPCycles            cpuAllocatedCycles;        // num cycles currently allocated
  206.     DSPCycles            cpuCurRealTimeLoading;    // num cycles used during the last frame
  207.     DSPCycles            cpuTimeShareLoading;    // num cycles it took for time share list
  208.     DSPCycles            cpuTimeShareFreq;        // how often the timeshare list is run
  209.     Fixed                cpuFrameRate;            // num frames per second for this cpu device
  210.     MessageActionProc    cpuClientMessageActionProc;
  211.     };
  212.     
  213. //======================================================================================
  214. // DSPIODeviceParamBlk
  215. //        this parameter block is used for controlling a io device. It shares the 
  216. //        DSPParamBlkHeader with the cpu device.
  217. //======================================================================================
  218. struct DSPIODeviceParamBlk {
  219.     DSPDeviceParamBlkHeader
  220.     unsigned short            iopbIODeviceIndex;    // index of this io device
  221.     unsigned short            iopbIODeviceType;    // type of this io device
  222.     unsigned char            iopbReserved[32];    // data specific to the io device
  223.     };
  224.  
  225. struct DSPBIODeviceParamBlk {
  226.     DSPDeviceParamBlkHeader
  227.     unsigned short            iopbIODeviceIndex;    // index of this io device
  228.     unsigned short            iopbIODeviceType;    // type  of this io device
  229.     struct DSPMessage        *bioMessageHandler;    // gets called when state of bio pin changes
  230.     unsigned char            bioPinState;        // 0 level low, 1 = logic level high
  231.     unsigned char            bioPinDirection;    // 0 = input only, 1 = output only
  232.     unsigned char            bioPinIntEnable;    // 0 = interrupt masked, 1 = interrupt enabled
  233.     unsigned char            bioReserved[25];    // reserved space
  234.     };
  235.  
  236. struct DSPSIODeviceParamBlk {
  237.     DSPDeviceParamBlkHeader
  238.     unsigned short            iopbIODeviceIndex;    // index of this io device
  239.     unsigned short            iopbIODeviceType;    // type of this io device
  240.     Fixed                    sioSampleRate;        // sample rate for this io device, rate is for both input and output
  241.     unsigned long            sioSampleFormat;    // sample size for this io device, size is for both input and output
  242.     DSPFIFOAddress            sioInputFIFO;        // pass the physical pointer to your dsp code
  243.     DSPFIFOAddress            sioOutputFIFO;        // pass the physical pointer to your dsp code
  244.     unsigned char            sioDMAEnable;        // 0 = off, 1 = on, enables both input and output
  245.     unsigned char            sioFeatures;        // contains bit that indicates if it can be used for standard sound etcÉ
  246.     unsigned char            sioReserved[6];        // reserved space
  247.     };
  248.     
  249.  
  250. //======================================================================================
  251. // DSPBandwidth: is used to represent guaranteed processing bandwidth 
  252. // information.
  253. //======================================================================================
  254. struct DSPBandwidth {                            // bn = ba-ndwidth
  255.     DSPCycles                bnEstimate;            // worst case pre-runtime
  256.     DSPCycles                bnActual;            // worst case runtime
  257.     unsigned long            bnFlags;            // control flags
  258.     };
  259.  
  260.  
  261. //======================================================================================
  262. // DSPMessage: used for passing messages back and forth between the kernel and the driver.
  263. //======================================================================================
  264. struct DSPMessage {
  265.     MessageActionProc        msVector;            // vector of routine
  266.     unsigned long            msData[3];            // application specific data
  267.     };
  268.     
  269. //======================================================================================
  270. // DSPGPBModeIndicator: used for requesting more (or less) GPB when a module is running.
  271. //======================================================================================
  272. struct DSPGPBModeIndicator {
  273.     unsigned short        miCurrentMode;            // Mode in which the module is operating 
  274.                                                 // (only the DSP code should change this)
  275.     unsigned short        miNextMode;                // (only the DSP Manager should change this value)
  276.     };
  277.  
  278. //======================================================================================
  279. //  ÒG E T   I N F OÓ   M E S S A G E   P A R A M   B L O C K S
  280. //======================================================================================
  281. //--------------------------------------------------------------------------------------
  282. // DSPClientInfoParamBlk
  283. //        this parameter block is used for getting information on a client that is
  284. //        signed in to the DSPManager.
  285. //--------------------------------------------------------------------------------------
  286. struct DSPClientInfoParamBlk {
  287.     DSPClientRefNum            ciClientRefNum;        // Returned ref num of the client
  288.     unsigned short            ciClientPermission;    // Returned read/write permission of the client
  289.     Handle                    ciClientICON;        // Returned icon of the client
  290.     Str31                    ciClientName;        // Returned name of the client
  291.     };
  292.  
  293. //--------------------------------------------------------------------------------------
  294. // DSPTaskInfoParamBlk
  295. //        this parameter block is used for getting information on a task that is
  296. //        installed on the DSP.
  297. //--------------------------------------------------------------------------------------
  298. struct DSPTaskInfoParamBlk {
  299.     DSPTaskRefNum            tiRefNum;            // Returned reference number for this task
  300.     unsigned long            tiRefCon;            // Returned application specific long
  301.     MessageActionProc        tiVector;            // Returned Vector of task action proc
  302.     unsigned long            tiFlags;            // Returned flags for DSPTask control
  303.     Str31                    tiName;                // Returned name of this DSPTask
  304.     };
  305.  
  306. //--------------------------------------------------------------------------------------
  307. // DSPModuleInfoParamBlk
  308. //        this parameter block is used for getting information on a module that is
  309. //        installed on the DSP.
  310. //--------------------------------------------------------------------------------------
  311. struct DSPModuleInfoParamBlk {
  312.     DSPModuleRefNum            miRefNum;            // Returned reference number of this module
  313.     struct DSPBandwidth        miGPB;                // Returned guaranteed processing bandwidth
  314.     unsigned long            miFlags;            // Returned module flags
  315.     unsigned long            miNumSections;        // Returned number of sections in module
  316.     Str31                    miName;                // Returned name of DSPModule
  317.     unsigned long            miExecutions;        // Returned number of executions
  318.     unsigned long            miSkipCount;        // Returned number of modules to skip
  319.     };
  320.  
  321. //--------------------------------------------------------------------------------------
  322. // DSPSectionInfoParamBlk
  323. //        this parameter block is used for getting information on a section that is
  324. //        installed on the DSP.
  325. //--------------------------------------------------------------------------------------
  326. struct DSPSectionInfoParamBlk {
  327.     DSPSectionRefNum        siRefNum;            // Returned reference number for this section
  328.     unsigned long            siSize;                // Returned size of data in actual section
  329.     unsigned long            siFlags;            // Returned section flags
  330.     unsigned long            siType;                // Returned for section connection type checking
  331.     Str31                    siName;                // Returned name of this section
  332.     Ptr                        siPrimary;            // Returned current location of section data
  333.     Ptr                        siSecondary;        // Returned optional section data storage location
  334.     DSPSectionRefNum        siPrevSection;        // Returned Previous Connection
  335.     DSPSectionRefNum        siNextSection;        // Returned Next Connection
  336.     DSPFIFORefNum            siFIFORefNum;        // Returned RefNum of the FIFO
  337.     };
  338.     
  339.     
  340. //======================================================================================
  341. //                 A D D I T I O N A L  S T R U C T U R E  D A T A  T Y P E S 
  342. //======================================================================================
  343. typedef    DSPCPUDeviceParamBlk    *DSPCPUDeviceParamBlkPtr,    **DSPCPUDeviceParamBlkHandle;
  344. typedef    DSPIODeviceParamBlk        *DSPIODeviceParamBlkPtr,    **DSPIODeviceParamBlkHandle;
  345. typedef    DSPBIODeviceParamBlk    *DSPBIODeviceParamBlkPtr,    **DSPBIODeviceParamBlkHandle;
  346. typedef    DSPSIODeviceParamBlk    *DSPSIODeviceParamBlkPtr,    **DSPSIODeviceParamBlkHandle;
  347. typedef    DSPClientInfoParamBlk    *DSPClientInfoParamBlkPtr,    **DSPClientInfoParamBlkHandle;
  348. typedef    DSPTaskInfoParamBlk        *DSPTaskInfoParamBlkPtr,    **DSPTaskInfoParamBlkHandle;
  349. typedef    DSPModuleInfoParamBlk    *DSPModuleInfoParamBlkPtr,    **DSPModuleInfoParamBlkHandle;
  350. typedef    DSPSectionInfoParamBlk    *DSPSectionInfoParamBlkPtr,    **DSPSectionInfoParamBlkHandle;
  351. typedef DSPGPBModeIndicator        *DSPGPBModeIndicatorPtr,    **DSPGPBModeIndicatorHandle;
  352.  
  353. #ifndef __cplusplus
  354. typedef    DSPMessage                *DSPMessagePtr,            **DSPMessageHandle;
  355. #else
  356. typedef    unsigned long            *DSPMessagePtr,            **DSPMessageHandle;
  357. #endif
  358.  
  359. //======================================================================================
  360. //                     D S P  M A N A G E R  T R A P  D I S P A T C H E R
  361. //======================================================================================
  362. //======================================================================================
  363. // misc dispatcher constants & macros
  364. //======================================================================================
  365. #define    _DSPDispatch                        0xABF5
  366. #define    MOVEL                                0x303C
  367. #define    DSPDispatch(select)                    {MOVEL,select,_DSPDispatch};
  368.  
  369. //======================================================================================
  370. // dispatch selectors for external calls
  371. //======================================================================================
  372. #define kdspGetTrapAddress                    0
  373. #define kdspSetTrapAddress                    1
  374. #define kdspGetIndexedCPUDevice                2
  375. #define kdspOpenCPUDevice                    3
  376. #define kdspCloseCPUDevice                    4
  377. #define kdspGetIndexedCPUDeviceOption        5
  378. #define kdspSetIndexedCPUDeviceOption        6
  379. #define kdspGetIndexedIODevice                7
  380. #define kdspOpenIODevice                    8
  381. #define kdspCloseIODevice                    9
  382. #define kdspGetIndexedIODeviceOption        10
  383. #define kdspSetIndexedIODeviceOption        11
  384. #define kdspSignInCPUDevice                    12
  385. #define kdspSignOutCPUDevice                13
  386. #define kdspSignInIODevice                    14
  387. #define kdspSignOutIODevice                    15
  388. #define kdspLoadModule                        16
  389. #define kdspUnloadModule                    17
  390. #define kdspConnectSections                    18
  391. #define kdspNewInterTaskBuffer                19
  392. #define kdspNewTask                            20
  393. #define kdspDisposeTask                        21
  394. #define kdspInsertTask                        22
  395. #define kdspManagerVersion                    23
  396. #define kdspRemoveTask                        24
  397. #define kdspTaskToSynchronize                25
  398. #define kdspAddressInZone                    26            // 4/16/92 JDB. Ripped out SynchronizeDevice
  399. #define kdspSynchronizeTasks                27
  400. #define kdspSetTaskActive                    28
  401. #define kdspSetTaskInactive                    29
  402. #define kdspCreateZone                        30
  403. #define kdspNewAddress                        31
  404. #define kdspDisposeAddress                    32
  405. #define kdspGetAddressSize                    33
  406. #define kdspGetZoneSize                        34
  407. #define kdspGetAddress                        35
  408. #define kdspGetZone                            36
  409. #define kdspInsertDouble                    37
  410. #define kdspRemoveDouble                    38
  411. #define kdspInsertSingle                    39
  412. #define kdspRemoveSingle                    40
  413. #define kdspGetSection                        41
  414. #define kdspNewFIFO                            42
  415. #define kdspDisposeFIFO                        43
  416. #define kdspGetSectionData                    44
  417. #define kdspFIFORead                        45
  418. #define    kdspFIFOWrite                        46
  419. #define    kdspFIFOGetReadCount                47
  420. #define    kdspFIFOGetWriteCount                48
  421. #define    kdspFIFOGetSize                        49
  422. #define kdspCreateModule                    50
  423. #define kdspInsertModule                    51
  424. #define kdspDisposeModule                    52
  425. #define kdspRemoveModule                    53
  426. #define kdspGetClientZone                    54
  427. #define kdspNewStorage                        55
  428. #define kdspAllocateStorage                    56
  429. #define kdspUnreserveStorage                57
  430. #define kdspDeallocateStorage                58
  431. #define kdspDisposeStorage                    59
  432. #define kdspProcessMessages                    60
  433. #define kdspFIFOClearInterrupt                61
  434. #define kdspFIFOGetRefCon                    62
  435. #define kdspFIFOSetRefCon                    63
  436. #define kdspFIFOGetMessageMode                64
  437. #define kdspFIFOSetMessageMode                65
  438. #define kdspFIFOReset                        66
  439. #define kdspSetTaskRefCon                    67
  440. #define kdspGetTaskRefCon                    68
  441. #define kdspGetIndexedClient                69
  442. #define kdspGetIndexedTask                    70
  443. #define kdspGetOwnerClient                    71
  444. #define kdspGetIndexedModule                72
  445. #define kdspGetOwnerTask                    73
  446. #define kdspGetIndexedSection                74
  447. #define kdspGetOwnerModule                    75
  448. #define kdspGetClientInfo                    76
  449. #define kdspGetTaskInfo                        77
  450. #define kdspGetModuleInfo                    78
  451. #define kdspGetSectionInfo                    79
  452. #define kdspConnectITBSections                80
  453. #define kdspConnectTwoFIFOSections            81
  454. #define kdspConnectFIFOToAIAOSections        82
  455. #define kdspConnectFIFOSections                83
  456. #define kdspConnectRegularSections            84
  457. #define kdspAllocate                        85
  458. #define kdspUpdateCPUDeviceInfo                86
  459. #define    kdspDisposeOneFIFO                    87
  460. #define    kdspFIFOSwap                        88
  461. #define kdspCountModule                        89
  462. #define kdspDontCountModule                    90
  463. #define kdspSetSkipCount                    91
  464. #define kdspGetTaskStatus                    92
  465. #define kdspSetCPUDeviceBondage                93
  466. #define kdspFIFOGetMessageDispatch            94
  467. #define kdspUpdateGPBPrefFile                95
  468. #define kdspFIFOSetMessageThreshold            96
  469. #define kdspSetGPBMode                        97
  470. #define kdspDontUpdateGPBPrefs                98
  471. #define kdspUpdateGPBPreferenceFile            99
  472. #define kdspConnectHIHOSections                100
  473. #define kdspDisposeZone                        101
  474. #define kdspClientMessageDispatch            102
  475. #define kdspFIFOGetMessageActionProc        103
  476. #define kdspFIFOSetMessageActionProc        104
  477. #define kdspSetSystemTask                    105
  478. #define kdspGetAvailableOnChipMemory        106
  479. #define kdspSetSectionSize                    107
  480. #define kdspGetPtrSize                        108
  481. #define kdspAllocateDriverFIFO                109
  482. #define kdspDisposeDriverFIFO                110
  483. #define kdspPatchPrevAndNext                111
  484. #define kdspSetUpLowAndHighPointerFromTask    112
  485. #define kdspAllocateSharedSections            113
  486. #define kdspAllocateSection                    114
  487. #define kdspAllocateModule                    115
  488. #define kdspNewStorageSection                116
  489. #define kdspClientRefNumToDSPClientPtr        117
  490. #define kdspGetDeviceRefNum                    118
  491. #define kdspAddClient                        119
  492. #define kdspRemoveClient                    120
  493. #define kdspGetCPUDeviceGivenIndex            121
  494. #define kdspGetIODeviceGivenIndex            122
  495. #define kdspUpdateIODeviceParamBlk            123
  496. #define kdspGetTaskGivenSectionTable        124
  497. #define kdspGetExceptionNotification        125
  498. #define kdspCPUDeviceRefNumToDevicePtr        126
  499. #define kdspConfigureSlaveDevice            127
  500.  
  501. //¥¥¥¥¥¥¥¥¥¥¥¥ 128-255 are for Standard Sound ¥¥¥¥¥¥¥¥¥
  502.  
  503. #define kdspGetCPUDeviceGivenRefNum            256
  504. #define kdspGetIODeviceGivenRefNum            257
  505. #define kdspGetFIFOPtr                        258
  506. #define kdspGetMaxCycles                    259
  507. #define kdspGetUsedCycles                    260
  508. #define kdspCyclesInTask                    261
  509. #define kdspNewPhysicalPtr                    262
  510. #define kdspDisposePhysicalPtr                263
  511. #define kdspVMPresent                        264
  512. #define kdspGetDSPZone                        265
  513. #define kdspComputePhysical                    266
  514. #define kdspCleanUpZone                        267
  515. #define kdspLogicalToPhysical                268
  516. #define kdspSectionStructPtr2RefNum            269
  517. #define kdspSectionRefNum2StructPtr            270
  518. #define kdspAttachAddrFixups                271
  519. #define kdspTryToCacheVanillaProgram        272
  520. #define kdspConvertDSPFtoDSPModule            273
  521. #define kdspGetTaskPtr                        274
  522. #define kdspGetModulePtr                    275
  523. #define kdspGetSectionPtr                    276
  524. #define kdspCheckTask                        277
  525. #define kdspPatchOneAddress                    278
  526. #define kdspPatchAllAddresses                279
  527. #define kdspSetUpTask                        280
  528. #define kdspTaskGetMessageDispatch            281
  529. #define kdspGetOverrunNotification            282
  530. #define kdspCheckHIHOConnections            283
  531. #define kdspPowerManager                    284
  532. #define kdspConvertFrameRate                285
  533. #define kdspAllocateSegment                    286
  534. #define kdspLoadKernel                        287
  535. #define kdspConnectIndirectSections            288
  536. #define kdspGetGPBModes                        289
  537. #define kdspDeviceCall                        290
  538. #define kdspDriverCall                        291
  539. #define kdspGetResource                        292
  540. #define kdspCreateAliasToResfile            293
  541. #define kdspRebootCPUDevice                    294
  542. #define kdspLoadSlotDrivers                    295
  543.  
  544. //======================================================================================
  545. // DSP Manager dispatched traps (external only)
  546. //======================================================================================
  547. pascal OSErr DSPGetIndexedCPUDevice (DSPCPUDeviceParamBlkPtr theCPUParamBlk)
  548.         = DSPDispatch(kdspGetIndexedCPUDevice)
  549. pascal OSErr DSPOpenCPUDevice (DSPCPUDeviceParamBlkPtr theCPUParamBlk)
  550.         = DSPDispatch(kdspOpenCPUDevice)
  551. pascal OSErr DSPCloseCPUDevice (DSPCPUDeviceParamBlkPtr theCPUParamBlk)
  552.         = DSPDispatch(kdspCloseCPUDevice)
  553. pascal OSErr DSPUpdateCPUDeviceInfo (DSPCPUDeviceParamBlkPtr theCPUParamBlk)
  554.         = DSPDispatch(kdspUpdateCPUDeviceInfo)
  555. pascal OSErr DSPGetIndexedCPUDeviceOption (DSPCPUDeviceParamBlkPtr theCPUParamBlk, 
  556.         unsigned short theOptionIndex, OSType theOptionType, unsigned long *theOption)
  557.         = DSPDispatch(kdspGetIndexedCPUDeviceOption)
  558. pascal OSErr DSPSetIndexedCPUDeviceOption (DSPCPUDeviceParamBlkPtr theCPUParamBlk, 
  559.         unsigned short theOptionIndex, OSType theOptionType)
  560.         = DSPDispatch(kdspSetIndexedCPUDeviceOption)
  561. pascal OSErr DSPGetIndexedIODevice (DSPIODeviceParamBlkPtr theIOParamBlk)
  562.         = DSPDispatch(kdspGetIndexedIODevice)
  563. pascal OSErr DSPOpenIODevice (DSPIODeviceParamBlkPtr theIOParamBlk)
  564.         = DSPDispatch(kdspOpenIODevice)
  565. pascal OSErr DSPCloseIODevice (DSPIODeviceParamBlkPtr theIOParamBlk)
  566.         = DSPDispatch(kdspCloseIODevice)
  567. pascal OSErr DSPGetIndexedIODeviceOption (DSPIODeviceParamBlkPtr theIOParamBlk, 
  568.         unsigned short theOptionIndex, OSType theOptionType, unsigned long *theOption)
  569.         = DSPDispatch(kdspGetIndexedIODeviceOption)
  570. pascal OSErr DSPSetIndexedIODeviceOption (DSPIODeviceParamBlkPtr theIOParamBlk, 
  571.         unsigned short theOptionIndex, OSType theOptionType)
  572.         = DSPDispatch(kdspSetIndexedIODeviceOption)
  573. pascal OSErr DSPLoadModule(    StringPtr theName, DSPTaskRefNum theTaskRefNum, 
  574.         DSPPosition thePosition, DSPModuleRefNum theReferenceModuleRefNum, 
  575.         DSPModuleRefNum *theNewModuleRefNum, long theScale )
  576.         = DSPDispatch(kdspLoadModule)
  577. pascal OSErr DSPUnloadModule( DSPTaskRefNum theTaskRefNum, 
  578.         DSPModuleRefNum theModuleRefNum )
  579.         = DSPDispatch(kdspUnloadModule)
  580. pascal OSErr DSPConnectSections ( DSPSectionRefNum sectionOneRefNum, 
  581.         DSPSectionRefNum sectionTwoRefNum, DSPConnectionType theConnectionType )
  582.         = DSPDispatch(kdspConnectSections)
  583. pascal OSErr DSPNewInterTaskBuffer ( DSPTaskRefNum theTaskRefNum, 
  584.         unsigned long theSize, unsigned short theDataType, 
  585.         Str31 theInterTaskBufferName, short bankPreference, 
  586.         DSPSectionRefNum *theReturnedSection )
  587.         = DSPDispatch(kdspNewInterTaskBuffer)
  588. pascal OSErr DSPNewTask( DSPCPUDeviceParamBlkPtr theCPUDevice, 
  589.         MessageActionProc theVector, StringPtr theTaskName, DSPTaskRefNum *theRefNum )
  590.         = DSPDispatch(kdspNewTask)
  591. pascal OSErr DSPDisposeTask( DSPTaskRefNum theTaskRefNum )
  592.         = DSPDispatch(kdspDisposeTask)
  593. pascal OSErr DSPInsertTask( DSPCPUDeviceParamBlkPtr theCPUDevice, 
  594.         DSPTaskRefNum theNewTaskRefNum, DSPPosition thePosition, 
  595.         DSPTaskPriority interruptLevel, DSPTaskRefNum theRelativeTaskRefNum )
  596.         = DSPDispatch(kdspInsertTask)
  597. pascal OSErr DSPRemoveTask( DSPTaskRefNum theTaskRefNum )
  598.         = DSPDispatch(kdspRemoveTask)
  599. pascal OSErr DSPTaskToSynchronize(DSPTaskRefNum theRefNum, unsigned long frameDelay, DSPSynchRefNum *synchRefNum)
  600.         = DSPDispatch(kdspTaskToSynchronize)
  601. pascal OSErr DSPSynchronizeTasks( DSPSynchRefNum *synchRefNum )
  602.         = DSPDispatch(kdspSynchronizeTasks)
  603. pascal OSErr DSPSetTaskActive (DSPTaskRefNum theRefNum)
  604.         = DSPDispatch(kdspSetTaskActive)
  605. pascal OSErr DSPSetTaskInactive (DSPTaskRefNum theRefNum)
  606.         = DSPDispatch(kdspSetTaskInactive)
  607. pascal OSErr DSPGetSection( DSPModuleRefNum theModuleRefNum, 
  608.         StringPtr theSectionName, DSPSectionRefNum *theSectionRefNum )
  609.         = DSPDispatch(kdspGetSection)
  610. pascal OSErr DSPNewFIFO (DSPSectionRefNum theSectionRefNum, 
  611.         DSPFIFORefNum *theFIFORefNum, unsigned long theSize, 
  612.         Ptr logical, Ptr physical, Boolean fifoFull,
  613.         MessageActionProc theInterrupt)
  614.         = DSPDispatch(kdspNewFIFO)
  615. pascal OSErr DSPDisposeFIFO (DSPSectionRefNum theSectionRefNum)
  616.         = DSPDispatch(kdspDisposeFIFO)
  617. pascal OSErr DSPFIFOFill (DSPFIFORefNum theFIFORefNum, unsigned long theSize, 
  618.         Ptr logical, Ptr physical, Boolean fifoFull,
  619.         MessageActionProc theInterrupt)
  620.         = DSPDispatch(kdspFIFOSwap)
  621. pascal OSErr DSPGetSectionData (DSPSectionRefNum theSectionRefNum, Ptr *theData)
  622.         = DSPDispatch(kdspGetSectionData)
  623. pascal unsigned long DSPFIFORead (DSPFIFORefNum theFIFORefNum, Ptr theDestination, 
  624.         unsigned long theCount)
  625.         = DSPDispatch(kdspFIFORead)
  626. pascal unsigned long DSPFIFOWrite (DSPFIFORefNum theFIFORefNum, Ptr theSource, 
  627.         unsigned long theCount)
  628.         = DSPDispatch(kdspFIFOWrite)
  629. pascal unsigned long DSPFIFOGetReadCount (DSPFIFORefNum theFIFORefNum)
  630.         = DSPDispatch(kdspFIFOGetReadCount)
  631. pascal unsigned long DSPFIFOGetWriteCount (DSPFIFORefNum theFIFORefNum)
  632.         = DSPDispatch(kdspFIFOGetWriteCount)
  633. pascal unsigned long DSPFIFOGetSize (DSPFIFORefNum theFIFORefNum)
  634.         = DSPDispatch(kdspFIFOGetSize)
  635. pascal OSErr DSPFIFOClearInterrupt (DSPFIFORefNum theFIFORefNum)
  636.         = DSPDispatch(kdspFIFOClearInterrupt)
  637. pascal unsigned long DSPFIFOGetRefCon (DSPFIFORefNum theFIFORefNum)
  638.         = DSPDispatch(kdspFIFOGetRefCon)
  639. pascal OSErr DSPFIFOSetRefCon (DSPFIFORefNum theFIFORefNum, unsigned long theValue)
  640.         = DSPDispatch(kdspFIFOSetRefCon)
  641. pascal unsigned long DSPFIFOGetMessageMode (DSPFIFORefNum theFIFORefNum)
  642.         = DSPDispatch(kdspFIFOGetMessageMode)
  643. pascal OSErr DSPFIFOSetMessageMode (DSPFIFORefNum theFIFORefNum, 
  644.         unsigned long theFlags)
  645.         = DSPDispatch(kdspFIFOSetMessageMode)
  646. pascal unsigned long DSPManagerVersion(void)
  647.         = DSPDispatch(kdspManagerVersion)
  648. pascal OSErr DSPFIFOReset (DSPFIFORefNum theFIFORefNum)
  649.         = DSPDispatch(kdspFIFOReset)
  650. pascal OSErr DSPSetTaskRefCon (DSPTaskRefNum theRefNum, unsigned long theData)
  651.         = DSPDispatch(kdspSetTaskRefCon)
  652. pascal unsigned long DSPGetTaskRefCon (DSPTaskRefNum theRefNum)
  653.         = DSPDispatch(kdspGetTaskRefCon)
  654. pascal OSErr DSPGetIndexedClient (unsigned long theIndex, DSPCPUDeviceParamBlkPtr theCPUDevice, DSPClientRefNum *theClientRefNum)
  655.         = DSPDispatch(kdspGetIndexedClient)
  656. pascal OSErr DSPGetIndexedTask (unsigned long theIndex, DSPTaskPriority interruptLevel, DSPCPUDeviceParamBlkPtr theCPUDevice, DSPTaskRefNum    *theTaskRefNum)
  657.         = DSPDispatch(kdspGetIndexedTask)
  658. pascal OSErr DSPGetOwnerClient (DSPTaskRefNum theTaskRefNum, DSPClientRefNum *theClientRefNum)
  659.         = DSPDispatch(kdspGetOwnerClient)
  660. pascal OSErr DSPGetIndexedModule (unsigned long theIndex, DSPTaskRefNum theTaskRefNum, DSPModuleRefNum *theModuleRefNum)
  661.         = DSPDispatch(kdspGetIndexedModule)
  662. pascal OSErr DSPGetOwnerTask (DSPModuleRefNum theModuleRefNum, DSPTaskRefNum *theTaskRefNum)
  663.         = DSPDispatch(kdspGetOwnerTask)
  664. pascal OSErr DSPGetIndexedSection (unsigned long theIndex, DSPModuleRefNum theModuleRefNum, DSPSectionRefNum *theSectionRefNum)
  665.         = DSPDispatch(kdspGetIndexedSection)
  666. pascal OSErr DSPGetOwnerModule (DSPSectionRefNum theSectionRefNum, DSPModuleRefNum *theModuleRefNum)
  667.         = DSPDispatch(kdspGetOwnerModule)
  668. pascal OSErr DSPGetClientInfo (DSPClientInfoParamBlkHandle theClientParamBlkHdl)
  669.         = DSPDispatch(kdspGetClientInfo)
  670. pascal OSErr DSPGetTaskInfo (DSPTaskInfoParamBlkHandle theTaskParamBlkHdl)
  671.         = DSPDispatch(kdspGetTaskInfo)
  672. pascal OSErr DSPGetModuleInfo (DSPModuleInfoParamBlkHandle theModuleParamBlkHdl)
  673.         = DSPDispatch(kdspGetModuleInfo)
  674. pascal OSErr DSPGetSectionInfo (DSPSectionInfoParamBlkHandle theSectionParamBlkHdl)
  675.         = DSPDispatch(kdspGetSectionInfo)
  676. pascal OSErr DSPCountModule(DSPModuleRefNum theModuleRefNum)
  677.         = DSPDispatch(kdspCountModule)
  678. pascal OSErr DSPDontCountModule(DSPModuleRefNum theModuleRefNum)
  679.         = DSPDispatch(kdspDontCountModule)
  680. pascal OSErr DSPSetSkipCount(DSPModuleRefNum theModuleRefNum, unsigned long theCount)
  681.         = DSPDispatch(kdspSetSkipCount)
  682. pascal DSPTaskStatus DSPGetTaskStatus(DSPTaskRefNum theRefNum)
  683.         = DSPDispatch(kdspGetTaskStatus)
  684. pascal OSErr DSPSetCPUDeviceBondage( DSPCPUDeviceParamBlkPtr cpuDevice1, DSPCPUDeviceParamBlkPtr cpuDevice2 )
  685.         = DSPDispatch(kdspSetCPUDeviceBondage)
  686. pascal OSErr DSPFIFOSetMessageThreshold(DSPFIFORefNum theFIFORefNum, unsigned long theThreshold)
  687.         = DSPDispatch(kdspFIFOSetMessageThreshold)
  688. pascal OSErr DSPFIFOSwap (DSPFIFORefNum theFIFORefNum, unsigned long theSize, Ptr logical, Ptr physical, Boolean fifoFull, MessageActionProc theInterrupt)
  689.         = DSPDispatch(kdspFIFOSwap)
  690. pascal OSErr DSPSetGPBMode(DSPModuleRefNum theModuleRefNum, unsigned short desiredMode )
  691.         = DSPDispatch(kdspSetGPBMode)
  692. pascal OSErr DSPDontUpdateGPBPrefs (DSPModuleRefNum theModuleRefNum)
  693.         = DSPDispatch(kdspDontUpdateGPBPrefs)
  694. pascal OSErr DSPUpdateGPBPreferenceFile (DSPModuleRefNum theModuleRefNum)
  695.         = DSPDispatch(kdspUpdateGPBPreferenceFile)
  696. pascal OSErr DSPFIFOGetMessageActionProc (DSPFIFORefNum theFIFORefNum, MessageActionProc *theVector)
  697.         = DSPDispatch(kdspFIFOGetMessageActionProc)
  698. pascal OSErr DSPFIFOSetMessageActionProc (DSPFIFORefNum theFIFORefNum, MessageActionProc theVector)
  699.         = DSPDispatch(kdspFIFOSetMessageActionProc)
  700. pascal OSErr DSPGetAvailableOnChipMemory(DSPModuleRefNum theModuleRefNum, unsigned long *theSize)
  701.         = DSPDispatch(kdspGetAvailableOnChipMemory)
  702. pascal OSErr DSPSetSectionSize(DSPSectionRefNum theSectionRefNum, unsigned long theSize)
  703.         = DSPDispatch(kdspSetSectionSize)
  704. #endif
  705.